package com.mfangsoft.zhuangjialong.app.order.mapper;

import java.util.List;
import java.util.Map;

import com.mfangsoft.zhuangjialong.app.order.model.OrderGift;
import com.mfangsoft.zhuangjialong.app.order.model.OrderGiving;
import com.mfangsoft.zhuangjialong.app.order.model.BaseOrder;
import com.mfangsoft.zhuangjialong.app.order.model.OrderInfo;
import com.mfangsoft.zhuangjialong.app.order.model.OrderPromote;
import com.mfangsoft.zhuangjialong.app.order.model.ProductInfo;
import com.mfangsoft.zhuangjialong.common.model.Page;
import com.mfangsoft.zhuangjialong.common.utils.stereotype.WriterRepository;

@WriterRepository
public interface AppOrderMapper {

	Integer addOrder(OrderInfo order);
	
	void addOrderProducts(ProductInfo product);
	
	Integer selectShopIdBySellerId(Integer sellerId);
	
	Integer selectExplainId(Integer shopId);
	
	List<OrderInfo> selectSellerOrderPage(Page<OrderInfo> page);
	
	List<OrderInfo> selectCustomerOrderPage(Page<OrderInfo> page);
	
	OrderInfo selectOrderDetail(Integer orderId);
	
	void updateOrder(OrderInfo order);

	BaseOrder selectHelperAllActivityOrder(BaseOrder baseOrder);

	/**
	 * 根据导购id查询消费者的所有订单
	 * @param page
	 * @return
	 */
	List<BaseOrder> selectOrderByUserManagerIdForPage(Page<OrderPromote> param);

	void deleteOrderProduct(Integer orderId);
	
	void addOrderGift(OrderGift orderGift);
	
	List<Map<String,Object>> selectOrderGift(Integer orderId);
	List<Map<String,Object>> selectActivityNum(Map<String,Object> map);
	List<Map<String,Object>> selectActivityPresentRule(Integer activityId);
	
	Integer selectNum(OrderGift orderGift);

	com.mfangsoft.zhuangjialong.integration.order.model.BaseOrder selectHelperAllActivityOrder(
			com.mfangsoft.zhuangjialong.integration.order.model.BaseOrder baseOrder);
	
	Integer addCustomerSeller(OrderInfo order);
	
	void updateOrderStatus(OrderInfo order);
	String selectFiliale(Integer shopId);
	Map<String,Object> selectSellerByCustomerId(Map<String,Object> map);
	
	Map<String,Object> selectActivityInfo(Integer activityId);
	
	Map<String,Object> selectShopExplain(Integer shopId);
	
	String selectGiftById(Integer giftId);
	
	String selectShopAddress(Integer shopId);
	void updateCustomerSeller(Map<String,Object> map);
	Integer selectOrderByOrderCode(String orderCode);
	Integer selectGiftCode(String code);
	Long selectActivityTime(Integer activityId);
	
	List<Map<String,Object>> selectCustomerActivity(Map<String,Object> map);
	
	List<ProductInfo> selectOrderProduct(Integer orderId);
	
	void updateGiftNum(Integer giftId);
	void updateActivityGiftNum(Integer activityId);

	void addOrderGiving(OrderGiving orderGiving);
	
	List<String> selectOrderGiving(Integer orderId);
	
	void deleteOrderGiving(Integer orderId);
	
	Integer selectSellerOrderPoint(Integer id);
}